package com.csu.backmanagesys.Service.impl;

import com.csu.backmanagesys.Domain.Product;
import com.csu.backmanagesys.Mapper.ProductMapper;
import com.csu.backmanagesys.Service.ProductService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;
@Service

public class ProductServiceImpl implements ProductService {
@Resource
private ProductMapper productMapper;



    @Override

    public List<Product> selectProductById(String id){
        return productMapper.selectProductById(id);
    }


    @Override
    public List<Product> fuzzySelectProduct(String param) {
        return productMapper.fuzzySelectProduct(param);
    }

    @Override
    public void insertProduct(
            String productId,
            String categoryId,
            String name,
            String description
    ){
        productMapper.insertProduct(productId,categoryId,name,description);
    }

    @Override
    public void deleteProduct(
            String productId
    ){
        productMapper.deleteProduct(productId);

    };
    @Override
    public List<Product> selectProduct(){
        return productMapper.selectProduct();

    };

    @Override
    public List<Product> selectProductByName(String name) {
        return productMapper.selectProductByName(name);
    }

    @Override
    public void updateProduct(
            String productId,
            String categoryId,
            String name,
            String description
    ){
        productMapper.updateProduct(productId,categoryId,name,description);

    };
    @Override
    public void updateProductName(
            String name, String productId
    ){
        productMapper.updateProductName(name, productId);

    };
    @Override
    public void updatePicture(String productId, String description) {
        productMapper.updatePicture(productId,description);
    }
}
